﻿using InterLock.Equipmet;
using System.Drawing;

namespace InterLock
{
    /// <summary>
    /// 信号显示状态类型
    /// </summary>
    public enum SignlType
    {
        normal,
        zxj,
        cxj,
        tg,
        dc
    };

    public enum EquipmentType
    {
        Signal,
        Track,
        Turnout,
    }
    public class Equipment
    {
        /// <summary>
        /// 信号机显示状态
        /// </summary>
        public virtual SignlType SignlState { get; set; } = SignlType.normal;

        /// <summary>
        /// 设备类型
        /// </summary>
        public EquipmentType EquipmentType { get; set; }

        /// <summary>
        /// 设备编号
        /// </summary>
        public int N { get; set; }

        /// <summary>
        /// 设备最左端X
        /// </summary>
        public int X1 { get; set; }

        /// <summary>
        /// 设备最左端Y
        /// </summary>
        public int Y1 { get; set; }
        public int X2 { get; set; }
        public int Y2 { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 设备特性
        /// </summary>
        public int Character { get; set; }

        /// <summary>
        /// 左直股节点号
        /// </summary>
        public int LZN { get; set; }

        /// <summary>
        ///  右节点直股号
        /// </summary>
        public int RZN { get; set; }

        /// <summary>
        /// 弯股号
        /// </summary>
        public int WGN { get; set; }

        /// <summary>
        /// 接近区段
        /// </summary>
        public int JJQ { get; set; }

        /// <summary>
        /// 防护区段
        /// </summary>
        public int FHQ { get; set; }

        /// <summary>
        /// 左边设备
        /// </summary>
        public Equipment L { get; set; }

        /// <summary>
        /// 右边设备
        /// </summary>
        public Equipment R { get; set; }

        /// <summary>
        /// 相连的弯股
        /// </summary>
        public Equipment W { get; set; }

        /// <summary>
        /// 获取设备所在区域
        /// </summary>
        public virtual Rectangle Region { get; set; }

        /// <summary>
        /// 锁闭状态
        /// </summary>
        public bool SJ { get; set; }

        /// <summary>
        /// 反位状态
        /// </summary>
        public bool FWJ { get; set; }

        /// <summary>
        /// 区段占用
        /// </summary>
        public bool ZYJ { get; set; }

        /// <summary>
        /// 设备被选中
        /// </summary>
        public bool IsClicked { get; set; }

        /// <summary>
        /// 绘制设备
        /// </summary>
        /// <param name="g"></param>
        public virtual void Draw(Graphics g)
        {

        }
    }
}
